<?php /* Smarty version 2.6.26, created on 2011-05-17 11:16:53
         compiled from index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'truncate', 'index.html', 258, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->_tpl_vars['name']; ?>
</title>
<link type="text/css" href="<?php echo $this->_tpl_vars['url_path']; ?>
/templates/css/base.css" rel="stylesheet" />
<link type="text/css" href="<?php echo $this->_tpl_vars['url_path']; ?>
/templates/css/common.css" rel="stylesheet" />
<link type="text/css" href="<?php echo $this->_tpl_vars['url_path']; ?>
/templates/css/page.css" rel="stylesheet" />

<script type="text/javascript">
var $ = function (id) {
    return "string" == typeof id ? document.getElementById(id) : id;
};

var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }
}

var Extend = function(destination, source) {
    for (var property in source) {
        destination[property] = source[property];
    }
    return destination;
}


var Calendar = Class.create();
Calendar.prototype = {
  initialize: function(container, options) {
	this.Container = $(container);//容器(table结构)
	this.Days = [];//日期对象列表
	
	this.SetOptions(options);
	
	this.Year = this.options.Year || new Date().getFullYear();
	this.Month = this.options.Month || new Date().getMonth() + 1;
	this.SelectDay = this.options.SelectDay ? new Date(this.options.SelectDay) : null;
	this.onSelectDay = this.options.onSelectDay;
	this.onToday = this.options.onToday;
	this.onFinish = this.options.onFinish;	
	
	this.Draw();
  },
  //设置默认属性
  SetOptions: function(options) {
	this.options = {//默认值
		Year:			0,//显示年
		Month:			0,//显示月
		SelectDay:		null,//选择日期
		onSelectDay:	function(){},//在选择日期触发
		onToday:		function(){},//在当天日期触发
		onFinish:		function(){}//日历画完后触发
	};
	Extend(this.options, options || {});
  },
  //当前月
  NowMonth: function() {
	this.PreDraw(new Date());
  },
  //上一月
  PreMonth: function() {
	this.PreDraw(new Date(this.Year, this.Month - 2, 1));
  },
  //下一月
  NextMonth: function() {
	this.PreDraw(new Date(this.Year, this.Month, 1));
  },
  //上一年
  PreYear: function() {
	this.PreDraw(new Date(this.Year - 1, this.Month - 1, 1));
  },
  //下一年
  NextYear: function() {
	this.PreDraw(new Date(this.Year + 1, this.Month - 1, 1));
  },
  //根据日期画日历
  PreDraw: function(date) {
	//再设置属性
	this.Year = date.getFullYear(); this.Month = date.getMonth() + 1;
	//重新画日历
	this.Draw();
  },
  //画日历
  Draw: function() {
	//用来保存日期列表
	var arr = [];
	//用当月第一天在一周中的日期值作为当月离第一天的天数
	for(var i = 1, firstDay = new Date(this.Year, this.Month - 1, 1).getDay(); i <= firstDay; i++){ arr.push(0); }
	//用当月最后一天在一个月中的日期值作为当月的天数
	for(var i = 1, monthDay = new Date(this.Year, this.Month, 0).getDate(); i <= monthDay; i++){ arr.push(i); }
	//清空原来的日期对象列表
	this.Days = [];
	//插入日期
	var frag = document.createDocumentFragment();
	while(arr.length){
		//每个星期插入一个tr
		var row = document.createElement("tr");
		//每个星期有7天
		for(var i = 1; i <= 7; i++){
			var cell = document.createElement("td"); cell.innerHTML = "&nbsp;";
			if(arr.length){
				var d = arr.shift();
				if(d){
					cell.innerHTML = d;
					this.Days[d] = cell;
					var on = new Date(this.Year, this.Month - 1, d);
					//判断是否今日
					this.IsSame(on, new Date()) && this.onToday(cell);
					//判断是否选择日期
					this.SelectDay && this.IsSame(on, this.SelectDay) && this.onSelectDay(cell);
				}
			}
			row.appendChild(cell);
		}
		frag.appendChild(row);
	}
	//先清空内容再插入(ie的table不能用innerHTML)
	while(this.Container.hasChildNodes()){ this.Container.removeChild(this.Container.firstChild); }
	this.Container.appendChild(frag);
	//附加程序
	this.onFinish();
  },
  //判断是否同一日
  IsSame: function(d1, d2) {
	return (d1.getFullYear() == d2.getFullYear() && d1.getMonth() == d2.getMonth() && d1.getDate() == d2.getDate());
  } 
}
</script>
<style type="text/css">

.Calendar {
	font-family:Verdana;
	font-size:12px;
	background-color:#FFF;
	text-align:center;
	width:80%;
	padding:10px;
	line-height:1.5em;
	margin-left:20px;
}
.Calendar a{
	color:#1e5494;
}

.Calendar table{
	width:100%; 
	border:0;
}

.Calendar table thead{color:#acacac;}

.Calendar table td {
	font-size: 11px;
	padding:1px;
}
#idCalendarPre{
	cursor:pointer;
	float:left;
	padding-right:5px;
}
#idCalendarNext{
	cursor:pointer;
	float:right;
	padding-right:5px;
}
#idCalendar td.onToday {
	font-weight:bold;
	color:#FFF;
	background:#666;
}
</style>
</head>

<body>
<div class="wrap">
  <!-- 头部 -->
  <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!-- /头部 -->
  <div class="main">
     <div class="mainLeft">
        <div>
           <div class="title"><h3 class="ml20 ffs f18 fb"><a href="userinfo.php">关于我</a></h3></div>
           <div class="mt30 ml30 f13">
            <ul class="tc fl">
            <li><img src="<?php echo $this->_tpl_vars['url_path']; ?>
<?php echo $this->_tpl_vars['myinfo']['user_img']; ?>
"width=108 title="<?php echo $this->_tpl_vars['myinfo']['user_info']; ?>
"/></li>
            <li class="f14 mt5"><a href="userinfo.php">&lt;&lt;&lt;个人资料</a></li>
            <?php if ($this->_tpl_vars['logined']): ?><li class="f14 mt5"><a href="editinfo.php">&lt;&lt;&lt;编辑资料</a></li><?php endif; ?>
            </ul>
            <ul class="fl ml30 mt10">
              <li title="<?php echo $this->_tpl_vars['myinfo']['user_info']; ?>
"><h4 class="ml30 f20 fb">博主：<?php echo $this->_tpl_vars['myinfo']['user_nickname']; ?>
</h4><a href="<?php echo $this->_tpl_vars['url']; ?>
?followid=<?php echo $this->_tpl_vars['weiboID']; ?>
"><input type="button" class="buttonShort" value="关注他" /></a></li>
              <li class="cb mt10"><?php echo $this->_tpl_vars['myinfo']['user_address']; ?>
</li>
              <li class="cb mt10">年龄：<?php echo $this->_tpl_vars['myinfo']['user_age']; ?>
岁</li>
              <li class="cb mt10">email:<a href="mailto:<?php echo $this->_tpl_vars['myinfo']['user_email']; ?>
"><?php echo $this->_tpl_vars['myinfo']['user_email']; ?>
</a></li>
              <!--  <li class="mt20">博客等级<span class="ml20">11</span></li>
              <li class="mt5">近日访问<span class="ml20">11</span></li>
              <li class="mt5">总访问量<span class="ml20">1111</span></li>
              <li class="mt5">最后登录<span class="ml20">2010-11-11 11:11</span></li> -->
            </ul>
            </div>
        </div>
        <div class="cb">
            <div class="title"><h3 class="ml20 ffs f18 fb">日历</h3></div>
            <div class="Calendar">
              <div id="idCalendarPre">&lt;&lt;</div>
              <div id="idCalendarNext">&gt;&gt;</div>
              <span id="idCalendarYear"></span>年 <span id="idCalendarMonth"></span>月
              <table cellspacing="0">
              <thead>
               <tr>
                <td>日</td>
                  <td>一</td>
                  <td>二</td>
                  <td>三</td>
                  <td>四</td>
                  <td>五</td>
                  <td>六</td>
               </tr>
             </thead>
            <tbody id="idCalendar">
            </tbody>
            </table>
          <input id="idCalendarPreYear" type="button" value="上一年" class="buttonShort" />
          <input id="idCalendarNow" type="button" value="当前月" class="buttonShort" />
          <input id="idCalendarNextYear" type="button" value="下一年" class="buttonShort" />
          </div>
          
        </div>
        <div class="cb">
            <div class="title"><h3 class="ml20 ffs f18 fb">留言</h3></div>
            <ul class="message mt15 ml30 f14">
            <?php unset($this->_sections['msg']);
$this->_sections['msg']['name'] = 'msg';
$this->_sections['msg']['loop'] = is_array($_loop=$this->_tpl_vars['remsg']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['msg']['show'] = true;
$this->_sections['msg']['max'] = $this->_sections['msg']['loop'];
$this->_sections['msg']['step'] = 1;
$this->_sections['msg']['start'] = $this->_sections['msg']['step'] > 0 ? 0 : $this->_sections['msg']['loop']-1;
if ($this->_sections['msg']['show']) {
    $this->_sections['msg']['total'] = $this->_sections['msg']['loop'];
    if ($this->_sections['msg']['total'] == 0)
        $this->_sections['msg']['show'] = false;
} else
    $this->_sections['msg']['total'] = 0;
if ($this->_sections['msg']['show']):

            for ($this->_sections['msg']['index'] = $this->_sections['msg']['start'], $this->_sections['msg']['iteration'] = 1;
                 $this->_sections['msg']['iteration'] <= $this->_sections['msg']['total'];
                 $this->_sections['msg']['index'] += $this->_sections['msg']['step'], $this->_sections['msg']['iteration']++):
$this->_sections['msg']['rownum'] = $this->_sections['msg']['iteration'];
$this->_sections['msg']['index_prev'] = $this->_sections['msg']['index'] - $this->_sections['msg']['step'];
$this->_sections['msg']['index_next'] = $this->_sections['msg']['index'] + $this->_sections['msg']['step'];
$this->_sections['msg']['first']      = ($this->_sections['msg']['iteration'] == 1);
$this->_sections['msg']['last']       = ($this->_sections['msg']['iteration'] == $this->_sections['msg']['total']);
?>
                  <li>
                      <h4 class="fl"><?php echo $this->_tpl_vars['remsg'][$this->_sections['msg']['index']]['re_name']; ?>
</h4><img src="<?php echo $this->_tpl_vars['url_path']; ?>
/templates/images/icon02.jpg" class="ml10"/><span class="fr"><?php echo $this->_tpl_vars['remsg'][$this->_sections['msg']['index']]['msg_time']; ?>
</span>
                      <p class="mt15"><?php echo $this->_tpl_vars['remsg'][$this->_sections['msg']['index']]['msg_content']; ?>
</p>
                      <p class="tr">IP:<?php echo $this->_tpl_vars['remsg'][$this->_sections['msg']['index']]['msg_IP']; ?>
</p>
                  </li>
            <?php endfor; endif; ?>     
            </ul>
            <p class="tr mt30 mb5"><a href="message.php?style=message">查看所有留言&gt;&gt;</a></p>
        </div>
         <div class="cb">
            <div class="title"><h3 class="ml20 ffs f18 fb">相片</h3></div>
            <div class="tc mt30"><img src="<?php echo $this->_tpl_vars['url_path']; ?>
/templates/images/alert-icon.jpg"/></div>
        </div>
     </div>
     <div class="mainMiddle">
        <div class="diary-list">
            <div class="title-short"><h3 class="ml20 ffs f18 fb">日记</h3></div>
            <ul>
              <?php unset($this->_sections['blog']);
$this->_sections['blog']['name'] = 'blog';
$this->_sections['blog']['loop'] = is_array($_loop=$this->_tpl_vars['myblogs']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['blog']['show'] = true;
$this->_sections['blog']['max'] = $this->_sections['blog']['loop'];
$this->_sections['blog']['step'] = 1;
$this->_sections['blog']['start'] = $this->_sections['blog']['step'] > 0 ? 0 : $this->_sections['blog']['loop']-1;
if ($this->_sections['blog']['show']) {
    $this->_sections['blog']['total'] = $this->_sections['blog']['loop'];
    if ($this->_sections['blog']['total'] == 0)
        $this->_sections['blog']['show'] = false;
} else
    $this->_sections['blog']['total'] = 0;
if ($this->_sections['blog']['show']):

            for ($this->_sections['blog']['index'] = $this->_sections['blog']['start'], $this->_sections['blog']['iteration'] = 1;
                 $this->_sections['blog']['iteration'] <= $this->_sections['blog']['total'];
                 $this->_sections['blog']['index'] += $this->_sections['blog']['step'], $this->_sections['blog']['iteration']++):
$this->_sections['blog']['rownum'] = $this->_sections['blog']['iteration'];
$this->_sections['blog']['index_prev'] = $this->_sections['blog']['index'] - $this->_sections['blog']['step'];
$this->_sections['blog']['index_next'] = $this->_sections['blog']['index'] + $this->_sections['blog']['step'];
$this->_sections['blog']['first']      = ($this->_sections['blog']['iteration'] == 1);
$this->_sections['blog']['last']       = ($this->_sections['blog']['iteration'] == $this->_sections['blog']['total']);
?>
             <li>
               <a href="blogs.php?style=diary&id=<?php echo $this->_tpl_vars['myblogs'][$this->_sections['blog']['index']]['blogID']; ?>
"><h4><?php echo $this->_tpl_vars['myblogs'][$this->_sections['blog']['index']]['blog_title']; ?>
</h4></a>
               <p><?php echo $this->_tpl_vars['myblogs'][$this->_sections['blog']['index']]['blog_pbtime']; ?>
</p>
               <p><?php echo ((is_array($_tmp=$this->_tpl_vars['myblogs'][$this->_sections['blog']['index']]['blog_content'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 500, "...") : smarty_modifier_truncate($_tmp, 500, "...")); ?>
</p>
               <p class="mt30"><a href="#">阅读（<?php echo $this->_tpl_vars['myblogs'][$this->_sections['blog']['index']]['read_num']; ?>
）</a>||<a href="blogs.php?style=diary&id=<?php echo $this->_tpl_vars['myblogs'][$this->_sections['blog']['index']]['blogID']; ?>
">评论(<?php echo $this->_tpl_vars['myblogs'][$this->_sections['blog']['index']]['count_comment']; ?>
)</a>||<a href="blogs.php?style=diary&id=<?php echo $this->_tpl_vars['myblogs'][$this->_sections['blog']['index']]['blogID']; ?>
">阅读全文&gt;&gt;</a></p>
             </li>
               <?php endfor; endif; ?>          
           </ul>
           <p class="tr mt20 mb5"><a href="blogs.php?style=diarylist">查看所有日志&gt;&gt;</a></p>
        </div>
     </div>
  <!-- 导航 -->
  <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!-- /导航 -->
  </div>
  <!-- 页脚 -->
  <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!-- /页脚 -->
</div>

<script language="JavaScript">

var cale = new Calendar("idCalendar", {
	onToday: function(o){ o.className = "onToday"; },
	onFinish: function(){
		$("idCalendarYear").innerHTML = this.Year; $("idCalendarMonth").innerHTML = this.Month;
	}
});

$("idCalendarPre").onclick = function(){ cale.PreMonth(); }
$("idCalendarNext").onclick = function(){ cale.NextMonth(); }

$("idCalendarPreYear").onclick = function(){ cale.PreYear(); }
$("idCalendarNextYear").onclick = function(){ cale.NextYear(); }

$("idCalendarNow").onclick = function(){ cale.NowMonth(); }

</script>
</body>
</html>